package oopday01;
//此类是用于验证子类创建对象的测试demo
public class ExtendsTestDemo {
    public static void main(String[] args) {
        //创建Student子类对象,调用无参构造方法
        Student zg = new Student();
        zg.name = "张光";
        zg.age=23;
        zg.address = "廊坊";
        zg.className = "JSD2509";
        zg.stuID = "001";
        zg.eat();
        zg.sleep();
        zg.sayHi();
        zg.study();
        System.out.println();
        //创建Student子类对象，调用全参构造方法
        Student  ll = new Student("李林",23,"廊坊","JSD2509","002");
        ll.eat();
        ll.sleep();
        ll.sayHi();
        ll.study();
        System.out.println();
        //
        Teacher zl = new Teacher("赵亮", 40, "上海", 6000.0);
        zl.eat();
        zl.sleep();
        zl.sayHi();
        zl.teach();
        System.out.println();
        //
        Doctor wpf = new Doctor("王鹏飞", 55, "长沙", "主治医生");
        wpf.eat();
        wpf.sleep();
        wpf.sayHi();
        wpf.cut();
        System.out.println();
        //
        Person p = new Person();
        p.name = "大锤妹妹";
        p.age = 18;
        p.address = "天津";
        p.eat();
        p.sleep();
        p.sayHi();

        //父类对象不可以调用子类的属性和方法
        //p.study();
        //p.teach();
        //p.cut();
    }
}
